#include <cstdio>
#include <map>

const int N = 2e2 + 5;
int n, m, a[N], ans[N];
std::map<int, int> map;

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen64("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen64("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("div.in", "r", stdin);
  freopen("div.out", "w", stdout);
#endif
#endif

  scanf("%d%d", &n, &m);
  for (int i = 1, lim; i <= m; ++i) {
    scanf("%d", &a[i]);
    lim = std::min(n, a[i]);
    for (int j = 1; j * j <= a[i] && j <= lim; ++j)
      if (a[i] % j == 0) {
        map[j]++;
        if (j * j != a[i] && a[i] / j <= lim) map[a[i] / j]++;
      }
  }

  for (std::map<int, int>::iterator i = map.begin(); i != map.end(); ++i)
    ans[i->second]++;
  printf("%d\n", n - (int)map.size());
  for (int i = 1; i <= m; ++i) printf("%d\n", ans[i]);
  return 0;
}